Release 10.1A: OpenEdge Development:
Programming Interfaces
Reading XML Schema into a temp-table, temp-table buffer, or ProDataSet
Reading XML Schema usingREAD-XMLSCHEMA( )has two distinct meanings, depending on your use case:
If you are creating a dynamic object, then reading XML Schema is the process of creating the definition of the dynamic object from the specified XML Schema.- If the object already has a definition, then reading XML Schema is the process of comparing the existing definition to the specified XML Schema. This comparison is known as verification. Since static objects cannot exist without a definition, the purpose of reading XML Schema into a static object is always verification. If a dynamic object already has its definition, then the purpose of reading XML Schema into it is also verification.
Verification allows you to test the compatibility of the object with the specified XML Schema document. If the object and XML Schema are not an exact or close match, the
Note: The XML document must be an XML Schema written in the XML Schema Definition (XSD) language in the 2001 XML Schema namespace (http://www.w3.org/2001/XMLSchema).READ-XMLSCHEMA( )method call fails and returnsFALSE. Theverification-modeparameter (described later) controls how close the match must be.
Here is the syntax forREAD-XMLSCHEMA( ). The method returnsTRUEorFALSEto indicate whether the operation was successful.
source-typeA
CHARACTERexpression that specifies the source XML document type. Valid values are:“FILE”,“MEMPTR”,“HANDLE”, and“LONGCHAR”.fileA
CHARACTERexpression that specifies the name of an XML Schema file. You can specify an absolute pathname, a relative pathname (based on the current working directory), or a URL pathname. Valid URL protocols includeFILEandHTTP(the HTTPS protocol is not supported). Progress verifies that the file exists and is accessible.memptrA
MEMPTRvariable that contains the XML Schema document text. The size of theMEMPTRvariable must match the size of the XML document text.handleA
WEB-CONTEXTsystem handle, X-document object handle, or X-noderef object handle.longcharA
LONGCHARvariable that contains the XML Schema document text.override-default-mappingA
LOGICALexpression whereTRUEdirects Progress to override the default mapping between XML Schema string and binary data types and Progress data types when creating a Progress temp-table schema from an XML Schema. The default value isFALSE.The XML Schema string data type maps to the Progress
CHARACTERdata type by default, and the XML Schemabase64BinaryandhexBinarydata types map to the ProgressRAWdata type by default. If you specifyTRUE, theREAD-XMLSCHEMA( )method creates a temp-table schema withCLOBandBLOBfields instead ofCHARACTERandRAWfields.If you specify the Unknown value (
Note: If the temp-table or ProDataSet has a Progress definition, this option is ignored.?), the method uses the default value ofFALSE.field-type-mappingAn optional
CHARACTERexpression that evaluates to a comma-separated list of field name, data type pairs using the following syntax:
This option allows you to specify the Progress data type for a specific field from the XML Schema. Generally, this option is only used to map fields from non-Progress generated schema. When reading and writing Progress-generated XML Schema, there is little need to override field mappings because of the Progress extensions to standard XML Schema.
field-nameThe name of the specified field. For a ProDataSet object, you must qualify the field name with the buffer name from the XML Schema. That is,
buffer-name.field-name.data-typeThe target 4GL data type for the specified field. The data type must be a valid Progress data type, and it must be compatible with the XML Schema type based on the Progress XML data type mapping rules. For example, any XML Schema type can be mapped to a Progress
CHARorCLOB, but an XML SchemadateTimecan be mapped only to a ProgressDATE,DATETIMEorDATETIME-TZ.If you specify the Unknown value (
Note: If the temp-table or ProDataSet has a Progress definition, this option is ignored.?), the method uses the default data type.For more information about the Progress XML data type mapping rules, see Appendix D, "XML Reference of Data Type and Code Page mappings".
verify-schema-modeAn optional
Note: For a dynamic temp-table or ProDataSet temp-table buffer that does not have Progress definition (that is, the object is in theCHARACTERexpression that specifies the mode in which theREAD-XMLSCHEMA( )method verifies any XML Schema against an existing Progress definition. The expression must evaluate to“LOOSE”or“STRICT”. The default value is“LOOSE”.CLEARstate), this option is ignored.Table 22–3 lists the
READ-XMLSCHEMA( )method schema verification modes.
If you specify the Unknown value (
?), the method uses the default value ofLOOSE.If the XML Schema verification fails, the method generates an error message indicating the XML Schema element that caused the failure and returns
FALSE.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |